package com.furongji.education.controller.admin;

import com.furongji.education.service.UserService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "用户数统计")
@AllArgsConstructor
@RestController
@RequestMapping("/admin/users")
public class UserStatisticsController {

    private final UserService userService;

    @Operation(summary = "注册人数统计")
    @GetMapping("/registerCount/{date}")
    public Integer registerCount(@PathVariable String date) {
        Integer registerCount = userService.registerCount(date);
        return registerCount;
    }

    @Operation(summary = "登录人数统计")
    @GetMapping("/loginCount/{date}")
    public Integer loginCount(@PathVariable String date) {
        Integer loginCount = userService.loginCount(date);
        return loginCount;
    }
}
